﻿using NUnit.Framework;
using OpenWaves.ImageTransformations;

namespace OpenWaves.UnitTests.ImageTransformations
{
    [TestFixture]
    public class ScaleDownToFitTransformationTests
    {
        [Test]
        public void ScaleDownToFitTransformation_survives_serialization_deserializtion_roundtrip()
        {
            var transformation = new ScaleDownToFitTransformation(100, 100);

            Assert.That(ImageTransformation.Parse(transformation.ToString()), Is.EqualTo(transformation));
        }

        [Test]
        public void Given_image_is_smaller_transformation_does_nothing()
        {
            var imageMock = ImageMock.Create(50, 50);

            new ScaleDownToFitTransformation(100, 100).ApplyToImage(imageMock.Object);

            imageMock.Verify();
        }
         
    }
}